﻿using System;
using System.Data;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using AnyOffice.Components;
using AnyOffice.DAL;

namespace AnyOffice.general.address.personal
{
    public partial class group_delete : ModulePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.Page.IsPostBack)
            {
                int groupId = (Request.QueryString["group_id"] == null) ? 0 : int.Parse(Request.QueryString["group_id"].ToString());
                new AddressGroupDao().Delete(base.Conn, groupId, base.User.Identity.Name);
                this.litMessage.Text = base.ShowPrompt("分组删除成功！", "group.aspx");
                StringBuilder builder = new StringBuilder("<script>\n");
                builder.Append("parent.menu.location.reload();\n");
                builder.Append("parent.main.location='group.aspx';\n");
                builder.Append("</script>\n");
                if (!this.Page.IsClientScriptBlockRegistered("AddressGroup_list"))
                {
                    this.Page.RegisterClientScriptBlock("AddressGroup_list", builder.ToString());
                }
            }
        } 

    }
}
